package jaux.tank.bean.entity.system;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;

import jaux.tank.utils.ObjectId;
@MappedSuperclass
public class EntityWithObjectId {

	@PrePersist
	public void generateObjectId() {
		id = ObjectId.get().toString();
	}
	
	@Id
	@Column(length = 40 )
	String id;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
}
